package com.acme.service.email;

import com.acme.domain.email.Email;
import com.acme.domain.email.Queue;
import com.acme.domain.email.impl.QueueImpl;

public class EmailService{

	private Queue queue = new QueueImpl(5);

	public Queue getQueue() {
		return queue;
	}

	private static EmailService instance = new EmailService();

	public static EmailService getEmailService() {
		return instance;
	}

	
	void sendNotificationEmail (Email email){
		System.out.println("put email into queue");
		queue.addEmail(email);
	}

	void close (){
		System.out.println("close signal");
		queue.close();
	}
	
}
